<%--
  Created by IntelliJ IDEA.
  User: 86191
  Date: 2022/11/27
  Time: 13:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>查看成绩</title>
    <style>
        body{
            background-image: url("imgs/Login.webp");
            background-repeat: no-repeat;
            background-size: cover;
        }
        div {
            width: 800px;
            margin: 100px auto;
        }

        table, tr, th, td {
            width: 100%;
            border: 0px solid rgb(13, 12, 12);
            border-collapse: collapse;
        }
        th{
            background-color: rgb(61, 127, 185);
        }
        th, td {
            /* 有四列 占25% */
            width: 20%;
        }

        thead {
            background-color: aliceblue;
        }

        td {
            text-align: center;
            height: 30px;
            width: 40px;
        }
    </style>
</head>
<body>
<div>
    <table>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>科目</th>
            <th>分数</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${requestScope.score}" var="users">
            <tr>
                <td>${users.u_id}</td>
                <td>${users.u_name}</td>
                <td>${users.c_name}</td>
                <td>${users.score}</td>
                <td>
                    <button onclick="update(${users.u_id})" style="color: red  ">修改成绩</button>
                </td>
            </tr>
        </c:forEach>
    </table>
    <script>
        function update(id){
            let x=prompt("请输入要修改的成绩为多少");
            window.location.href="update?x="+x+"&id="+id;
        }
    </script>
</div>
</body>
</html>
